home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume7 / elm_update / part1 next >
Encoding:
Internet Message Format  |  1986-11-30  |  57.6 KB

  1. Subject:  v07i018:  ELM Update Kit, Part01/03
  2. Newsgroups: mod.sources
  3. Approved: mirror!rs
  4.  
  5. Submitted by: Dave Taylor <taylor@hplabs.HP.COM>
  6. Mod.sources: Volume 7, Issue 18
  7. Archive-name: elm_update/Part01
  8.  
  9. [  The shell scripts in this posting should be run on a clean copy of
  10.    the ELM sources.  Then run the "Configure.sh" script now provided,
  11.    to build the Makefiles, etc.  I suppose this is a good time to say
  12.    that Dave said to ignore errors in unpacking Part 12 of the Volume
  13.    6 ELM distribution.  -- r$  ]
  14.  
  15. #!/bin/sh
  16. # This is a shell archive.  Remove anything before this line,
  17. # then unpack it by saving it in a file and typing "sh file".
  18.  
  19. # Exit status; set to 1 on "wc" errors or if would overwrite.
  20. STATUS=0
  21. # Contents:  Edit1
  22.  
  23. echo x - Edit1
  24. if test -f Edit1 ; then
  25.     echo Edit1 exists, putting output in $$Edit1
  26.     OUT=$$Edit1
  27.     STATUS=1
  28. else
  29.     OUT=Edit1
  30. fi
  31. sed 's/^XX//' > $OUT <<'@//E*O*F Edit1//'
  32. XX: Use /bin/sh
  33.  
  34. XX# This is the automatically generated output of the AUTODIFF program after
  35. XX# being run on the two directories;
  36. XX#
  37. XX#    Old Directory: Elm-Posted
  38. XX#    New Directory: Elm
  39.  
  40. XX# Any problems with execution of this script should be reported to the 
  41. XX#     author of the program, Dave Taylor, at "hplabs!taylor".  Thanks
  42.  
  43. XX# first off, let's make sure we're running in SH
  44.  
  45. XXexport PATH || (sh $0; exit $$)
  46.  
  47. XX# next, let's ensure the user has "ed"...
  48.  
  49. XXif [ ! -f /bin/ed ]
  50. XXthen
  51. XX  echo I can\'t find /bin/ed\!
  52. XX  exit 1
  53. XXfi
  54.  
  55. XX# finally, let's get this show on the road!!
  56.  
  57. XX#-------------------------------------
  58. XX# File 'doc/newmail.1' diffs...
  59.  
  60. XXcat << 'EOF' > doc/newmail.D
  61. XX36a
  62. XXIf the message is a \fIpriority\fR message (that is, it has a field
  63. XXin the header "Priority:"), then the line will be "PRIORITY mail"
  64. XXinstead of "New mail".
  65. XX.P
  66. XX.
  67. XXw
  68. XXEOF
  69.  
  70. XXchars=`cat doc/newmail.1 | wc -c`
  71.  
  72. XXif [ $chars -ne 1214 ]
  73. XXthen
  74. XX  echo Your file doc/newmail.1 has been changed\!
  75. XX  echo diffs saved as \"doc/newmail.D\"
  76. XXelse
  77. XX  echo applying diffs to file doc/newmail.1...
  78. XX  /bin/cat doc/newmail.D | /bin/ed - doc/newmail.1
  79. XXfi
  80.  
  81. XX#-------------------------------------
  82. XX# File 'doc/readmsg.1' diffs...
  83.  
  84. XXcat << 'EOF' > doc/readmsg.D
  85. XX137a
  86. XX.SH BUGS
  87. XXThe '*' metacharacter doesn't always work as expected!
  88. XX.br
  89. XXPerhaps the pattern matching should be case insensitive?
  90. XX.
  91. XX50c
  92. XXthe last message in the mailfile.  Similarly, '*' is understood to
  93. XXrepresent every message in the file (that is, 1-$)
  94. XX.
  95. XXw
  96. XXEOF
  97.  
  98. XXchars=`cat doc/readmsg.1 | wc -c`
  99.  
  100. XXif [ $chars -ne 3454 ]
  101. XXthen
  102. XX  echo Your file doc/readmsg.1 has been changed\!
  103. XX  echo diffs saved as \"doc/readmsg.D\"
  104. XXelse
  105. XX  echo applying diffs to file doc/readmsg.1...
  106. XX  /bin/cat doc/readmsg.D | /bin/ed - doc/readmsg.1
  107. XXfi
  108.  
  109. XX#-------------------------------------
  110. XX# File 'doc/Config.guide' diffs...
  111.  
  112. XXcat << 'EOF' > doc/Config.gui.D
  113. XX349c
  114. XX-------------------------------------------------------------------------------------
  115. XX.
  116. XX140c
  117. XX                                           (can't be within this boundary)    */
  118. XX.
  119. XX120c
  120. XX-------------------------------------------------------------------------------------
  121. XX.
  122. XX84c
  123. XXsystems, including HP-UX (and the \fISPECTRUM\fR series!) or simulations thereof.
  124. XX.
  125. XX68a
  126. XXIt's \fIhighly\fR recommended that installation be done by using the
  127. XX\fBConfigure.sh\fR script supplied with the system.  Please see the
  128. XXfile \fIInstructions\fR for further information.
  129. XX.sp 2
  130. XX.P
  131. XX.
  132. XXw
  133. XXEOF
  134.  
  135. XXchars=`cat doc/Config.guide | wc -c`
  136.  
  137. XXif [ $chars -ne 20499 ]
  138. XXthen
  139. XX  echo Your file doc/Config.guide has been changed\!
  140. XX  echo diffs saved as \"doc/Config.gui.D\"
  141. XXelse
  142. XX  echo applying diffs to file doc/Config.guide...
  143. XX  /bin/cat doc/Config.gui.D | /bin/ed - doc/Config.guide
  144. XXfi
  145.  
  146. XX#-------------------------------------
  147. XX# File 'doc/wnewmail.1' diffs...
  148.  
  149. XXcat << 'EOF' > doc/wnewmail.D
  150. XX37a
  151. XXIf the message is a \fIpriority\fR message (that is, the
  152. XXheader contains a line "Priority:"), then the line output
  153. XXwill be "PRIORITY mail from ..." rather than just "Mail from".
  154. XX.P
  155. XX.
  156. XXw
  157. XXEOF
  158.  
  159. XXchars=`cat doc/wnewmail.1 | wc -c`
  160.  
  161. XXif [ $chars -ne 1318 ]
  162. XXthen
  163. XX  echo Your file doc/wnewmail.1 has been changed\!
  164. XX  echo diffs saved as \"doc/wnewmail.D\"
  165. XXelse
  166. XX  echo applying diffs to file doc/wnewmail.1...
  167. XX  /bin/cat doc/wnewmail.D | /bin/ed - doc/wnewmail.1
  168. XXfi
  169.  
  170. XX#-------------------------------------
  171. XX# File 'doc/Ref.guide' diffs...
  172.  
  173. XXcat << 'EOF' > doc/Ref.gui.D
  174. XX290,291c
  175. XXThere is also a built in pager, considerably faster than calling
  176. XXa remote one, called 'builtin'.  This is the default if none is
  177. XXspecified.
  178. XX.
  179. XXw
  180. XXEOF
  181.  
  182. XXchars=`cat doc/Ref.guide | wc -c`
  183.  
  184. XXif [ $chars -ne 39623 ]
  185. XXthen
  186. XX  echo Your file doc/Ref.guide has been changed\!
  187. XX  echo diffs saved as \"doc/Ref.gui.D\"
  188. XXelse
  189. XX  echo applying diffs to file doc/Ref.guide...
  190. XX  /bin/cat doc/Ref.gui.D | /bin/ed - doc/Ref.guide
  191. XXfi
  192.  
  193. XX#-------------------------------------
  194. XX# File 'doc/Users.guide' diffs...
  195.  
  196. XXcat << 'EOF' > doc/Users.gui.D
  197. XX857c
  198. XXnamely Guy Hillyer, Bruce Townsend and special guest appearances
  199. XX(almost \fIall\fR the BSD fixes for Elm 1.1) by Eric Negaard.
  200. XX.
  201. XX841c
  202. XXJohn Dilley (who got the SPECTRUM version checked out, too!) and Carl Dierschow.
  203. XX.
  204. XX541c
  205. XX.mk a
  206. XX.
  207. XX517c
  208. XX.mk a
  209. XX.
  210. XX425c
  211. XX.mk a
  212. XX.
  213. XX393c
  214. XX.mk a
  215. XX.
  216. XX166,167c
  217. XX.mk a
  218. XX.mk a
  219. XX.
  220. XXw
  221. XXEOF
  222.  
  223. XXchars=`cat doc/Users.guide | wc -c`
  224.  
  225. XXif [ $chars -ne 25463 ]
  226. XXthen
  227. XX  echo Your file doc/Users.guide has been changed\!
  228. XX  echo diffs saved as \"doc/Users.gui.D\"
  229. XXelse
  230. XX  echo applying diffs to file doc/Users.guide...
  231. XX  /bin/cat doc/Users.gui.D | /bin/ed - doc/Users.guide
  232. XXfi
  233.  
  234. XX#-------------------------------------
  235. XX# File 'doc/elm.1' diffs...
  236.  
  237. XXcat << 'EOF' > doc/elm.1.D
  238. XX65a
  239. XX.TP
  240. XX.
  241. XX63a
  242. XX.TP
  243. XX.
  244. XX21c
  245. XX.B \-s 
  246. XX.
  247. XX8c
  248. XX.B \-achkKmrwz
  249. XX.
  250. XXw
  251. XXEOF
  252.  
  253. XXchars=`cat doc/elm.1 | wc -c`
  254.  
  255. XXif [ $chars -ne 2788 ]
  256. XXthen
  257. XX  echo Your file doc/elm.1 has been changed\!
  258. XX  echo diffs saved as \"doc/elm.1.D\"
  259. XXelse
  260. XX  echo applying diffs to file doc/elm.1...
  261. XX  /bin/cat doc/elm.1.D | /bin/ed - doc/elm.1
  262. XXfi
  263.  
  264. XX#---------------------------------
  265. XX# File Elm/doc/messages.1 is new!
  266.  
  267. XXecho File Elm/doc/messages.1 is new - extracting...
  268. XXif [ -f doc/messages.1 ]
  269. XXthen
  270. XX  echo File \'doc/messages.1\' is new, but you already have something called that\!
  271. XX  echo I\'m going to move your file to \'doc/messages.1.old\'...
  272. XX  /bin/mv -f doc/messages.1 doc/messages.1.old
  273. XXelse
  274. XX  echo Extracting new file \'doc/messages.1\'
  275. XXfi
  276.  
  277. XXcat > doc/messages.1 << 'END_OF_FILE'
  278. XX.TH MESSAGES 1L
  279. XX.ad b
  280. XX.SH NAME
  281. XXmessages - quick count of messages in mailbox or folder
  282. XX.SH SYNOPSIS
  283. XX.B messages
  284. XX.br
  285. XX.B messages
  286. XXfolder-name
  287. XX.SH HP-UX COMPATIBILITY
  288. XX.TP 10
  289. XXLevel:
  290. XXHP-UX/STANDARD
  291. XX.TP
  292. XXOrigin:
  293. XXHewlett-Packard
  294. XX.SH DESCRIPTION
  295. XX.I Messages
  296. XXcounts the occurances of "^From\ " in either the current incoming 
  297. XXmailbox or the specified folder.
  298. XX.P
  299. XXThis is, in fact, a simple little shell script!!
  300. XX.SH AUTHOR
  301. XXDave Taylor, Hewlett-Packard Laboratories
  302. XX.SH SEE\ ALSO
  303. XXfrom(1L), elm(1L)
  304. XX.SH BUGS
  305. XXDon't be foolish...
  306. XXEND_OF_FILE
  307.  
  308. XXchars=`cat doc/messages.1 | wc -c`
  309.  
  310. XXif [ $chars -ne 515 ]
  311. XXthen
  312. XX  echo File damaged in transit...should be 515 bytes, is $chars instead
  313. XX  echo  I suggest you check it closely...
  314. XXfi
  315.  
  316. XX#---------------------------------
  317. XX# File Elm/doc/trim-headers.1 is new!
  318.  
  319. XXecho File Elm/doc/trim-headers.1 is new - extracting...
  320. XXif [ -f doc/trim-headers.1 ]
  321. XXthen
  322. XX  echo File \'doc/trim-headers.1\' is new, but you already have something called that\!
  323. XX  echo I\'m going to move your file to \'doc/trim-headers.1.old\'...
  324. XX  /bin/mv -f doc/trim-headers.1 doc/trim-headers.1.old
  325. XXelse
  326. XX  echo Extracting new file \'doc/trim-headers.1\'
  327. XXfi
  328.  
  329. XXcat > doc/trim-headers.1 << 'END_OF_FILE'
  330. XX.TH TRIM-HEADERS 1L
  331. XX.ad b
  332. XX.SH NAME
  333. XXtrim-headers - help keep mailbox files clean of trash headers
  334. XX.SH SYNOPSIS
  335. XXcat \fIfilename\fR |
  336. XX.B trim-headers
  337. XX> \fIfilename2\fR
  338. XX.br
  339. XX.B trim-headers
  340. XXfilename-list
  341. XX.SH HP-UX COMPATIBILITY
  342. XX.TP 10
  343. XXLevel:
  344. XXHP-UX/STANDARD
  345. XX.TP
  346. XXOrigin:
  347. XXHewlett-Packard Laboratories
  348. XX.SH DESCRIPTION
  349. XX.I Trim-headers
  350. XXis a simple awk script that removes all headers from the specified
  351. XXfolder, either standard input or one of a list of filenames, according
  352. XXto how it's invoked.  The program knows about the following headers;
  353. XX.sp
  354. XX.nf
  355. XX    From 
  356. XX    From:
  357. XX    Subject:
  358. XX    To:
  359. XX    Cc:
  360. XX    Date:
  361.  
  362. XX.fi
  363. XXAll other headers are considered extraneous and are removed.
  364. XX.SH AUTHOR
  365. XXDave Taylor, Hewlett-Packard Laboratories
  366. XX.SH SEE\ ALSO
  367. XXawk(1), printmail(1L), readmsg(1L)
  368. XX.SH BUGS
  369. XXThe current incancation of the \fIawk\fR script doesn't understand
  370. XXthe idea of multiple line header fields, so a message that has, say,
  371. XXa three line To: list will only have the first line saved...
  372. XXEND_OF_FILE
  373.  
  374. XXchars=`cat doc/trim-headers.1 | wc -c`
  375.  
  376. XXif [ $chars -ne 955 ]
  377. XXthen
  378. XX  echo File damaged in transit...should be 955 bytes, is $chars instead
  379. XX  echo  I suggest you check it closely...
  380. XXfi
  381.  
  382. XX#-------------------------------------
  383. XX# File 'src/alias.c' diffs...
  384.  
  385. XXcat << 'EOF' > src/alias.c.D
  386. XX288a
  387. XX              if (mini_menu) show_alias_menu();
  388. XX.
  389. XX244c
  390. XX              PutLine1(LINES-1,0,"Aliased address: %-60.60s", 
  391. XX.
  392. XX240c
  393. XX                      PutLine1(LINES-1,0,"Group alias:%-60.60s", address);
  394. XX.
  395. XX225a
  396. XX        case LINE_FEED:
  397. XX.
  398. XXw
  399. XXEOF
  400.  
  401. XXchars=`cat src/alias.c | wc -c`
  402.  
  403. XXif [ $chars -ne 7725 ]
  404. XXthen
  405. XX  echo Your file src/alias.c has been changed\!
  406. XX  echo diffs saved as \"src/alias.c.D\"
  407. XXelse
  408. XX  echo applying diffs to file src/alias.c...
  409. XX  /bin/cat src/alias.c.D | /bin/ed - src/alias.c
  410. XXfi
  411.  
  412. XX#-------------------------------------
  413. XX# File 'src/curses.c' diffs...
  414.  
  415. XXcat << 'EOF' > src/curses.c.D
  416. XX422c
  417. XX    printf(_clearbold);
  418. XX.
  419. XX409c
  420. XX    printf("%s", _setbold);        /* don't ask, okay? */
  421. XX.
  422. XX174c
  423. XX    if (strlen(termcap_label) < 2)
  424. XX      return(NULL);
  425.  
  426. XX    if (termcap_label[0] == 's' && termcap_label[1] == 'o')
  427. XX      sprintf(escape_sequence, _setinverse);
  428. XX    else if (termcap_label[0] == 's' && termcap_label[1] == 'e')
  429. XX      sprintf(escape_sequence, _clearinverse);
  430. XX    else if ((myptr = tgetstr(termcap_label, &ptr)) == NULL)
  431. XX      return( (char *) NULL );
  432. XX    else
  433. XX      sprintf(escape_sequence, myptr);
  434.  
  435. XX.
  436. XX170c
  437. XX    char *myptr, *tgetstr();             /* Get termcap capability */
  438. XX.
  439. XX152,155d
  440. XX114a
  441. XX#ifdef BSD
  442. XX    initscr();    /* initalize curses too! */
  443. XX#endif
  444.  
  445. XX.
  446. XX44a
  447. XX#ifdef SHORTNAMES
  448. XX# define CleartoEOS    ClrtoEOS
  449. XX# define _clearinverse    _clrinv
  450. XX# define _cleartoeoln    _clrtoeoln
  451. XX# define _cleartoeos    _clr2eos
  452. XX# define _transmit_off    xmit_off
  453. XX# define _transmit_on    xmit_on
  454. XX#endif
  455.  
  456. XX.
  457. XX28c
  458. XX#  ifndef BSD4.1
  459. XX#    include <sgtty.h>
  460. XX#  endif
  461. XX.
  462. XXw
  463. XXEOF
  464.  
  465. XXchars=`cat src/curses.c | wc -c`
  466.  
  467. XXif [ $chars -ne 15951 ]
  468. XXthen
  469. XX  echo Your file src/curses.c has been changed\!
  470. XX  echo diffs saved as \"src/curses.c.D\"
  471. XXelse
  472. XX  echo applying diffs to file src/curses.c...
  473. XX  /bin/cat src/curses.c.D | /bin/ed - src/curses.c
  474. XXfi
  475.  
  476. XX#-------------------------------------
  477. XX# File 'src/date.c' diffs...
  478.  
  479. XXcat << 'EOF' > src/date.c.D
  480. XX372a
  481.  
  482. XX#ifdef SITE_HIDING
  483.  
  484. XXchar *get_ctime_date()
  485. XX{
  486. XX    /** returns a ctime() format date, but a few minutes in the 
  487. XX        past...(more cunningness to implement hidden sites) **/
  488.  
  489. XX    static char buffer[SLEN];    /* static character buffer       */
  490. XX    struct tm *the_time,        /* Time structure, see CTIME(3C) */
  491. XX          *localtime();
  492. XX    long       junk;        /* time in seconds....         */
  493. XX#ifdef BSD
  494. XX    struct  timeval  time_val;        
  495. XX    struct  timezone time_zone;
  496. XX#endif
  497.  
  498. XX#ifdef BSD
  499. XX    gettimeofday(&time_val, &time_zone);
  500. XX    junk = time_val.tv_sec;
  501. XX#else
  502. XX    junk = (long) time((long *) 0);    /* this must be here for it to work! */
  503. XX#endif
  504. XX    the_time = localtime(&junk);
  505.  
  506. XX    sprintf(buffer, "%s %s %d %02d:%02d:%02d %d",
  507. XX      arpa_dayname[the_time->tm_wday],
  508. XX      arpa_monname[the_time->tm_mon],
  509. XX      the_time->tm_mday % 32,
  510. XX      min(the_time->tm_hour % 24, (rand() % 24)),
  511. XX      min(abs(the_time->tm_min  % 61 - (rand() % 60)), (rand() % 60)),
  512. XX      min(abs(the_time->tm_sec  % 61 - (rand() % 60)), (rand() % 60)),
  513. XX      the_time->tm_year % 100 + 1900);
  514. XX    
  515. XX    return( (char *) buffer);
  516. XX}
  517.  
  518. XX#endif
  519. XX.
  520. XX339c
  521. XX    return( minute1 - minute2 );        /* ignore seconds... */
  522. XX.
  523. XX335a
  524. XX    /* did we get the time?  If not, try again */
  525.  
  526. XX    if (minute1 < 0)
  527. XX      sscanf(rec1->time, "%2d%2d", &hour1, &minute1);
  528.  
  529. XX    if (minute2 < 0)
  530. XX      sscanf(rec2->time, "%2d%2d", &hour2, &minute2);
  531.  
  532. XX    /** deal with am/pm, if present... **/
  533.  
  534. XX    if (strlen(rec1->time) > 3)
  535. XX      if (rec1->time[strlen(rec1->time)-2] == 'p')
  536. XX        hour1 += 12;
  537.  
  538. XX    if (strlen(rec2->time) > 3)
  539. XX      if (rec2->time[strlen(rec2->time)-2] == 'p')
  540. XX        hour2 += 12;
  541.  
  542. XX.
  543. XX332a
  544. XX    minute1 = minute2 = -1;
  545.  
  546. XX.
  547. XX282c
  548. XX      sprintf(timestring, "12:%2.2d (midnight)", minute);
  549. XX.
  550. XX192c
  551. XX    junk = (long) time((long *) 0);    /* this must be here for it to work! */
  552. XX.
  553. XX146a
  554. XX# endif
  555. XX.
  556. XX145a
  557. XX# ifdef BSD4.1
  558. XX      timezone(time_zone.timezone, the_time->tm_isdst));
  559. XX# else
  560. XX.
  561. XX134a
  562.  
  563. XX.
  564. XX133c
  565. XX    junk = (long) time((long *) 0);    /* this must be here for it to work! */
  566. XX.
  567. XX131a
  568. XX# endif
  569.  
  570. XX.
  571. XX129d
  572. XX127d
  573. XX124a
  574. XX# ifdef BSD4.1
  575. XX    struct timeb    loc_time;
  576.  
  577. XX    junk = (long) time(long *) 0);
  578. XX    ftime(&loc_time);
  579. XX# else
  580. XX.
  581. XX123a
  582.  
  583. XX.
  584. XX68c
  585. XX    junk = (long) time((long *) 0);    /* this must be here for it to work! */
  586. XX.
  587. XX18a
  588. XX#undef tolower
  589. XX.
  590. XX10c
  591. XX#  ifndef BSD4.1
  592. XX#    include <sys/time.h>
  593. XX#  else
  594. XX#    include <time.h>
  595. XX#    include <sys/types.h>
  596. XX#    include <sys/timeb.h>
  597. XX#  endif
  598. XX.
  599. XX8a
  600.  
  601. XX.
  602. XXw
  603. XXEOF
  604.  
  605. XXchars=`cat src/date.c | wc -c`
  606.  
  607. XXif [ $chars -ne 9538 ]
  608. XXthen
  609. XX  echo Your file src/date.c has been changed\!
  610. XX  echo diffs saved as \"src/date.c.D\"
  611. XXelse
  612. XX  echo applying diffs to file src/date.c...
  613. XX  /bin/cat src/date.c.D | /bin/ed - src/date.c
  614. XXfi
  615.  
  616. XX#-------------------------------------
  617. XX# File 'src/delete.c' diffs...
  618.  
  619. XXcat << 'EOF' > src/delete.c.D
  620. XX80c
  621. XX      if (msg == current && !arrow_cursor) {
  622. XX        StartBold();
  623. XX        PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
  624. XX           ison(header_table[msg].status, DELETED)? 'D' : ' ',
  625. XX           ison(header_table[msg].status, TAGGED )? '+' : ' ');
  626. XX        EndBold();
  627. XX      }
  628. XX      else
  629. XX        PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
  630. XX.
  631. XX67c
  632. XX      if (msg == current && !arrow_cursor) {
  633. XX        StartBold();
  634. XX        Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
  635. XX        EndBold();
  636. XX      }
  637. XX      else
  638. XX        Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
  639. XX.
  640. XX44c
  641. XX      if (msg == current && !arrow_cursor) {
  642. XX        StartBold();
  643. XX        Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
  644. XX        EndBold();
  645. XX      }
  646. XX      else
  647. XX        Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
  648. XX.
  649. XXw
  650. XXEOF
  651.  
  652. XXchars=`cat src/delete.c | wc -c`
  653.  
  654. XXif [ $chars -ne 1863 ]
  655. XXthen
  656. XX  echo Your file src/delete.c has been changed\!
  657. XX  echo diffs saved as \"src/delete.c.D\"
  658. XXelse
  659. XX  echo applying diffs to file src/delete.c...
  660. XX  /bin/cat src/delete.c.D | /bin/ed - src/delete.c
  661. XXfi
  662.  
  663. XX#-------------------------------------
  664. XX# File 'src/aliasdb.c' diffs...
  665.  
  666. XXcat << 'EOF' > src/aliasdb.D
  667. XX169c
  668. XX    } while (absolute(last) - absolute(first) > FIND_DELTA);
  669. XX.
  670. XX135a
  671. XX       strcat(expanded, comment);        /* add comment */
  672. XX.
  673. XX132a
  674. XX        }
  675. XX.
  676. XX131c
  677. XX        else {                 /* We just can't get there! */
  678. XX          strcpy(expanded, old_name);    /* restore! */
  679. XX.
  680. XX124a
  681. XX           strcat(expanded, comment);    /* patch in comment */
  682. XX.
  683. XX104a
  684. XX    dprint3(5,"\nBroke address into '%s' @ '%s' '%s'\n\n",
  685. XX        name, sitename, comment);
  686.  
  687. XX.
  688. XX94c
  689. XX    while (cryptic[i] != '\0' && cryptic[i] != '(' && 
  690. XX               ! whitespace(cryptic[i]))
  691. XX.
  692. XX81c
  693. XX           cryptic[i] != '\0' && cryptic[i] != '(')
  694. XX.
  695. XX79a
  696. XX    /** first, rip out the comment, if any **/
  697.  
  698. XX    if ((i = chloc(cryptic, '(')) > -1) {
  699. XX      comment[j++] = ' ';            /* leading space */
  700. XX      for ( ;cryptic[i] != ')'; i++)
  701. XX          comment[j++] = cryptic[i];
  702. XX      comment[j++] = ')';
  703. XX      comment[j] = '\0';
  704. XX      /* and remove this from cryptic string too... */
  705. XX      if (cryptic[(j = chloc(cryptic,'('))-1] == ' ')
  706. XX        cryptic[j-1] = '\0';
  707. XX      else
  708. XX        cryptic[j] = '\0';
  709. XX    }
  710. XX    else
  711. XX      comment[0] = '\0';
  712.  
  713. XX    i = j = 0;    /* reset */
  714.  
  715. XX.
  716. XX72c
  717. XX               temp[VERY_LONG_STRING], old_name[VERY_LONG_STRING],
  718. XX           comment[LONG_STRING];
  719. XX.
  720. XX62c
  721. XX        0 = found, -1 return means unknown site code 
  722. XX    
  723. XX        Modified to strip out parenthetical comments...
  724. XX    **/
  725. XX.
  726. XX40,41c
  727. XX          if (mail_only)
  728. XX            printf("Warning: couldn't expand %s...\n\r", name);
  729. XX          else {
  730. XX            error1("Warning: couldn't expand %s...", name);
  731. XX            sleep(1);
  732. XX          }
  733. XX.
  734. XX13a
  735. XX#define  absolute(x)        ((x) > 0 ? x : -(x))
  736.  
  737. XX.
  738. XXw
  739. XXEOF
  740.  
  741. XXchars=`cat src/aliasdb.c | wc -c`
  742.  
  743. XXif [ $chars -ne 5484 ]
  744. XXthen
  745. XX  echo Your file src/aliasdb.c has been changed\!
  746. XX  echo diffs saved as \"src/aliasdb.D\"
  747. XXelse
  748. XX  echo applying diffs to file src/aliasdb.c...
  749. XX  /bin/cat src/aliasdb.D | /bin/ed - src/aliasdb.c
  750. XXfi
  751.  
  752. XX#-------------------------------------
  753. XX# File 'src/file.c' diffs...
  754.  
  755. XXcat << 'EOF' > src/file.c.D
  756. XX158c
  757. XX    ptr = filename;
  758. XX    while (*ptr == ' ') ptr++;    /* leading spaces GONE! */
  759. XX    strcpy(filename, ptr);
  760.  
  761. XX    /** New stuff - make sure no illegal char as last **/
  762. XX.
  763. XX155c
  764. XX    char buffer[SLEN], varname[SLEN], env_value[SLEN], *ptr;
  765. XX.
  766. XX79a
  767. XX#endif
  768. XX.
  769. XX78a
  770. XX#ifdef BSD4.1
  771. XX    if ((errno = ((can_open(filename, "a") & ~0x0200) >>8))) {
  772. XX#else
  773. XX.
  774. XXw
  775. XXEOF
  776.  
  777. XXchars=`cat src/file.c | wc -c`
  778.  
  779. XXif [ $chars -ne 5704 ]
  780. XXthen
  781. XX  echo Your file src/file.c has been changed\!
  782. XX  echo diffs saved as \"src/file.c.D\"
  783. XXelse
  784. XX  echo applying diffs to file src/file.c...
  785. XX  /bin/cat src/file.c.D | /bin/ed - src/file.c
  786. XXfi
  787.  
  788. XX#-------------------------------------
  789. XX# File 'src/read_rc.c' diffs...
  790.  
  791. XXcat << 'EOF' > src/read_rc.D
  792. XX367c
  793. XX          pmalloc(strlen(default_list[weedcount]) + 1)) == NULL) {
  794. XX.
  795. XX342c
  796. XX                   pmalloc(sizeof *alternative_addresses);
  797. XX.
  798. XX334c
  799. XX                   pmalloc(sizeof *alternative_addresses);
  800. XX.
  801. XX305c
  802. XX        if ((weedlist[weedcount] = pmalloc(strlen(header) + 1)) == NULL) {
  803. XX.
  804. XX63c
  805. XXchar *shift_lower(), *strtok(), *getenv(), *pmalloc();
  806. XX.
  807. XXw
  808. XXEOF
  809.  
  810. XXchars=`cat src/read_rc.c | wc -c`
  811.  
  812. XXif [ $chars -ne 12722 ]
  813. XXthen
  814. XX  echo Your file src/read_rc.c has been changed\!
  815. XX  echo diffs saved as \"src/read_rc.D\"
  816. XXelse
  817. XX  echo applying diffs to file src/read_rc.c...
  818. XX  /bin/cat src/read_rc.D | /bin/ed - src/read_rc.c
  819. XXfi
  820.  
  821. XX#-------------------------------------
  822. XX# File 'src/hdrconfg.c' diffs...
  823.  
  824. XXcat << 'EOF' > src/hdrconfg.D
  825. XX95c
  826. XX        case 'I' : if (strlen(in_reply_to) > 0) {
  827. XX.
  828. XX84c
  829. XX        case 'R' : if (optionally_enter(reply_to, 7, 10, FALSE) == -1)
  830. XX.
  831. XX67c
  832. XX        case RETURN:
  833. XX        case LINE_FEED:
  834. XX.
  835. XXw
  836. XXEOF
  837.  
  838. XXchars=`cat src/hdrconfg.c | wc -c`
  839.  
  840. XXif [ $chars -ne 4054 ]
  841. XXthen
  842. XX  echo Your file src/hdrconfg.c has been changed\!
  843. XX  echo diffs saved as \"src/hdrconfg.D\"
  844. XXelse
  845. XX  echo applying diffs to file src/hdrconfg.c...
  846. XX  /bin/cat src/hdrconfg.D | /bin/ed - src/hdrconfg.c
  847. XXfi
  848.  
  849. XX#-------------------------------------
  850. XX# File 'src/help.c' diffs...
  851.  
  852. XXcat << 'EOF' > src/help.c.D
  853. XX9a
  854.  
  855. XX#ifdef BSD
  856. XX# undef tolower
  857. XX#endif
  858.  
  859. XX.
  860. XXw
  861. XXEOF
  862.  
  863. XXchars=`cat src/help.c | wc -c`
  864.  
  865. XXif [ $chars -ne 5576 ]
  866. XXthen
  867. XX  echo Your file src/help.c has been changed\!
  868. XX  echo diffs saved as \"src/help.c.D\"
  869. XXelse
  870. XX  echo applying diffs to file src/help.c...
  871. XX  /bin/cat src/help.c.D | /bin/ed - src/help.c
  872. XXfi
  873.  
  874. XX#-------------------------------------
  875. XX# File 'src/initialize.c' diffs...
  876.  
  877. XXcat << 'EOF' > src/initialize.D
  878. XX199a
  879.  
  880. XX    /** allocate the first KLICK headers... **/
  881.  
  882. XX    if ((header_table = (struct header_rec *) malloc(KLICK * sizeof (struct
  883. XX         header_rec))) == NULL) {
  884. XX       fprintf(stderr,"\n\r\n\rCouldn't allocate initial headers!\n\r\n");
  885. XX       leave();
  886. XX    }
  887. XX    max_headers = KLICK;        /* we have those preallocated */
  888.  
  889. XX    /** now cruise along... **/
  890. XX.
  891. XX181a
  892. XX    dprint0(1,"past the return_ stuff\n");
  893.  
  894. XX.
  895. XX174a
  896. XX        else if (strlen(cp) != 2)
  897. XX          cursor_control = FALSE;
  898. XX.
  899. XX173c
  900. XX        if ((cp = return_value_of("kd")) == NULL)
  901. XX.
  902. XX169,171c
  903. XX      cursor_control = FALSE;
  904.  
  905. XX      if ((cp = return_value_of("ku")) != NULL)
  906. XX       if (strlen(cp) != 2) {
  907. XX        dprint0(1,"ku != NULL\n");
  908. XX.
  909. XX148a
  910. XX    ScreenSize(&LINES, &COLUMNS);
  911.  
  912. XX.
  913. XX113,114c
  914. XX            full_username[j++] = pass->pw_gecos[i];
  915. XX      full_username[j] = '\0'; 
  916. XX.
  917. XX110c
  918. XX            j = strlen(full_username);
  919. XX.
  920. XX108c
  921. XX            full_username[j] = '\0';
  922. XX.
  923. XX105c
  924. XX      /* fix for this section from Don Joslyn of Nova University */
  925. XX      for (i=0,j=0; pass->pw_gecos[i] != '\0' && pass->pw_gecos[i] != ',';
  926. XX.
  927. XX74a
  928. XX#endif
  929. XX.
  930. XX72a
  931. XX#ifndef BSD    /* if BSD we've already done this! */
  932. XX.
  933. XX46c
  934. XX    register int i, j;
  935. XX.
  936. XX34c
  937. XXchar *error_name(), *error_description(), *malloc();
  938. XX.
  939. XX31d
  940. XX27a
  941. XX#undef toupper
  942. XX.
  943. XXw
  944. XXEOF
  945.  
  946. XXchars=`cat src/initialize.c | wc -c`
  947.  
  948. XXif [ $chars -ne 7108 ]
  949. XXthen
  950. XX  echo Your file src/initialize.c has been changed\!
  951. XX  echo diffs saved as \"src/initialize.D\"
  952. XXelse
  953. XX  echo applying diffs to file src/initialize.c...
  954. XX  /bin/cat src/initialize.D | /bin/ed - src/initialize.c
  955. XXfi
  956.  
  957. XX#-------------------------------------
  958. XX# File 'src/showmsg.c' diffs...
  959.  
  960. XXcat << 'EOF' > src/showmsg.D
  961. XX275,276c
  962. XX      if (errno != 0)
  963. XX        dprint1(1,"\terror %s hit!\n", error_name(errno));
  964. XX    }
  965. XX}
  966.  
  967. XXint
  968. XXsecure_display(lines, msgnumber)
  969. XXint lines, msgnumber;
  970. XX{
  971. XX    /** This is the cheap way to implement secure pipes - spawn a
  972. XX        child process running under the old userid, then open the
  973. XX        pager and feed the message to it.  When the subprocess ends
  974. XX        (the routine returns) simply return.  Simple and effective.
  975. XX        (too bad it's this much of a hassle to implement secure
  976. XX        pipes, though - I can imagine it being a constant problem!)
  977. XX    **/
  978.  
  979. XX    int stat = 0, pid, w;
  980. XX#ifdef BSD
  981. XX    union wait status;
  982. XX#else
  983. XX    int status;
  984. XX#endif
  985. XX    register int (*istat)(), (*qstat)();
  986. XX    
  987. XX#ifdef NO_VM        /* machine without virtual memory! */
  988. XX    if ((pid = fork()) == 0) {
  989. XX#else
  990. XX    if ((pid = vfork()) == 0) {
  991. XX#endif
  992.  
  993. XX      setgid(groupid);    /* and group id            */
  994. XX      setuid(userid);    /* back to the normal user! */
  995.  
  996. XX      _exit(display(lines, msgnumber));
  997. XX    }
  998.  
  999. XX    istat = signal(SIGINT, SIG_IGN);
  1000. XX    qstat = signal(SIGQUIT, SIG_IGN);
  1001.  
  1002. XX    while ((w = wait(&status)) != pid && w != -1)
  1003. XX        ;
  1004.  
  1005. XX    signal(SIGINT, istat);
  1006. XX    signal(SIGQUIT, qstat);
  1007.  
  1008. XX#ifdef BSD
  1009. XX    return(status.w_retcode);
  1010. XX#else
  1011. XX    return(status);
  1012. XX#endif
  1013. XX.
  1014. XX272,273c
  1015. XX    if (builtin) {
  1016. XX      strcat(buffer, "\n\r");
  1017. XX      pipe_abort = display_line(buffer);
  1018. XX    }
  1019. XX    else {
  1020. XX      errno = 0;
  1021. XX      fprintf(output_pipe, "%s\n", buffer);
  1022. XX.
  1023. XX270c
  1024. XX    /** Hands the given line to the output pipe.  'builtin' is true if
  1025. XX        we're using the builtin pager.  **/ 
  1026. XX.
  1027. XX268a
  1028. XXint  builtin;
  1029. XX.
  1030. XX267c
  1031. XXshow_line(buffer, builtin)
  1032. XX.
  1033. XX259c
  1034. XX      if (! builtin)
  1035. XX        PutLine0(LINES+1,0,"\rPress <return> to return to Elm: ");
  1036. XX      else
  1037. XX        Write_to_screen("\n\r\n\rPress <return> to return to Elm: ");
  1038. XX.
  1039. XX257c
  1040. XX    if (! builtin) pclose(output_pipe);
  1041.  
  1042. XX.
  1043. XX251c
  1044. XX            show_line(buffer, builtin);
  1045. XX.
  1046. XX248c
  1047. XX              show_line(buffer, builtin);
  1048. XX.
  1049. XX243c
  1050. XX            show_line(buffer, builtin); 
  1051. XX.
  1052. XX238c
  1053. XX              show_line(buffer, builtin);
  1054. XX.
  1055. XX235c
  1056. XX              show_line(buffer, builtin);
  1057. XX.
  1058. XX221c
  1059. XX        show_line(buffer, builtin);
  1060. XX.
  1061. XX194c
  1062. XX        if (!builtin)
  1063. XX              PutLine0(LINES+1,0,"\rPress <return> to return to Elm: ");
  1064. XX            else
  1065. XX          Write_to_screen("\n\r\n\rPress <return> to return to Elm: ");
  1066. XX.
  1067. XX192c
  1068. XX          if (!builtin) 
  1069. XX            pclose(output_pipe);
  1070. XX.
  1071. XX188c
  1072. XX            if (!builtin) pclose(output_pipe);    /* close pipe NOW! */
  1073. XX        show_mailfile_stats();
  1074. XX.
  1075. XX173,176d
  1076. XX154a
  1077. XX        if (builtin)
  1078. XX          display_line(buffer);
  1079. XX        else
  1080. XX          fprintf(output_pipe, "%s", buffer);
  1081. XX      }
  1082. XX.
  1083. XX152,153c
  1084. XX          strlen(header_table[current-1].to) > 0) {
  1085. XX        sprintf(buffer, "\n\r(message addressed to %s)\n\r", 
  1086. XX.
  1087. XX149a
  1088. XX      if (builtin)
  1089. XX        display_line(buffer);
  1090. XX      else
  1091. XX        fprintf(output_pipe, "%s", buffer);
  1092.  
  1093. XX.
  1094. XX140,148c
  1095. XX           mail_sent? "to" : "from", from_buffer,
  1096. XX           (strlen(from_buffer) > 24? "\n\r": 
  1097. XX             (strlen(from_buffer) > 16 ? "" : "\t")),
  1098. XX           notesfile? "Posted" : "Mailed",
  1099. XX                full_month(header_table[msgnum-1].month), 
  1100. XX           header_table[msgnum-1].day, 
  1101. XX               atoi(header_table[msgnum-1].year) + 1900,
  1102. XX               header_table[msgnum-1].time,
  1103. XX           filter? "": "\n\r\n\r");
  1104. XX.
  1105. XX137,138c
  1106. XX      tail_of(header_table[msgnum-1].from, from_buffer, FALSE);
  1107.  
  1108. XX      sprintf(buffer, "\r%s #%d %s %s%s\t %s %s %s, %d at %s%s\n\r",
  1109. XX.
  1110. XX131d
  1111. XX124,129c
  1112. XX    builtin = (strcmp(pager, "builtin") == 0 || 
  1113. XX           strcmp(pager,"internal") == 0);
  1114.  
  1115. XX    if (builtin) 
  1116. XX      start_builtin(lines);
  1117. XX    else {
  1118. XX      if ((output_pipe = popen(pager,"w")) == NULL) {
  1119. XX        error2("Can't create pipe to %s [%s]", pager, 
  1120. XX            error_name(errno));
  1121. XX        dprint2(1,"\n*** Can't create pipe to %s - error %s ***\n\n",
  1122. XX               pager, error_name(errno));
  1123. XX        return(0);
  1124. XX      }
  1125. XX      dprint1(4,"Opened a write-only pipe to routine %s \n", pager);
  1126. XX.
  1127. XX121a
  1128. XX    ClearScreen();
  1129.  
  1130. XX    if (cursor_control) transmit_functions(OFF);
  1131.  
  1132. XX.
  1133. XX117c
  1134. XX    int mail_sent,                /* misc use   */
  1135. XX        builtin = FALSE;            /* our pager? */
  1136. XX.
  1137. XX111c
  1138. XX    char from_buffer[LONG_STRING], buffer[VERY_LONG_STRING], *full_month();
  1139. XX.
  1140. XX99c
  1141. XXFILE   *output_pipe, *popen();
  1142. XX.
  1143. XX88c
  1144. XX    if (strcmp(pager,"builtin") == 0 || strcmp(pager,"internal") == 0)
  1145. XX      display(lines, msgnumber);
  1146. XX    else
  1147. XX      secure_display(lines, msgnumber);
  1148. XX.
  1149. XX84a
  1150. XX    if (feof(mailfile))
  1151. XX      dprint0(1,"\n*** seek put us at END OF FILE!!! ***\n");
  1152.  
  1153. XX.
  1154. XX17c
  1155. XX# include <sys/wait.h>
  1156. XX# undef tolower
  1157. XX.
  1158. XX14a
  1159. XX#include <signal.h>
  1160. XX.
  1161. XX11d
  1162. XX8a
  1163. XX   Modified 7/86 to have secure pipes.. *sigh*
  1164. XX.
  1165. XXw
  1166. XXEOF
  1167.  
  1168. XXchars=`cat src/showmsg.c | wc -c`
  1169.  
  1170. XXif [ $chars -ne 7704 ]
  1171. XXthen
  1172. XX  echo Your file src/showmsg.c has been changed\!
  1173. XX  echo diffs saved as \"src/showmsg.D\"
  1174. XXelse
  1175. XX  echo applying diffs to file src/showmsg.c...
  1176. XX  /bin/cat src/showmsg.D | /bin/ed - src/showmsg.c
  1177. XXfi
  1178.  
  1179. XX#-------------------------------------
  1180. XX# File 'src/newmbox.c' diffs...
  1181.  
  1182. XXcat << 'EOF' > src/newmbox.D
  1183. XX352,353c
  1184. XX    header_table[count > 0? count-1:count].lines = line + 1;
  1185. XX    
  1186. XX.
  1187. XX266a
  1188. XX    
  1189. XX        /** try to allocate new headers, if needed... **/
  1190.  
  1191. XX        if (count >= max_headers) {
  1192. XX          max_headers += KLICK;
  1193. XX          dprint2(1,
  1194. XX          "\n\nAbout to allocate headers, count = %d, max_headers=%d\n",
  1195. XX          count, max_headers);
  1196. XX          if ((temp_struct = (struct header_rec *) realloc(header_table,
  1197. XX            max_headers * sizeof(struct header_rec))) == NULL) {
  1198. XX            error1(
  1199. XX      "\n\r\n\rCouldn't allocate enough memory!  Failed on message #%d\n\r\n\r",
  1200. XX            count);
  1201. XX            leave();
  1202. XX           }
  1203. XX           header_table = temp_struct;
  1204. XX           dprint1(1,"\tallocated %d more headers!\n\n", KLICK);
  1205. XX         }
  1206. XX         else 
  1207. XX           dprint1(1,"\ndidn't need to allocate headers: count=%d\n\n",
  1208. XX            count);
  1209. XX          
  1210. XX.
  1211. XX241c
  1212. XX         line = 0;
  1213. XX.
  1214. XX239c
  1215. XX         line = header_table[message_count - 1].lines;
  1216. XX.
  1217. XX185a
  1218. XX        if (access(temp_filename, ACCESS_EXISTS) != -1) {
  1219. XX          /* Hey!  What the hell is this?  The temp file already exists? */
  1220. XX          /* Looks like a potential clash of processes on the same file! */
  1221. XX          unlock();                     /* so remove lock file! */
  1222. XX          error("What's this?  The temp mailbox already exists??");
  1223. XX          sleep(2);
  1224. XX          error("Ahhhh.....I give up");
  1225. XX          silently_exit();    /* leave without tampering with it! */
  1226. XX        }
  1227. XX.
  1228. XX151a
  1229. XX    struct header_rec *temp_struct;
  1230. XX.
  1231. XX120c
  1232. XX    if (mailfile != NULL)
  1233. XX      (void) fclose(mailfile);  /* close it first, to avoid too many open */
  1234. XX.
  1235. XX114a
  1236. XX    if (switching_from_default) {    /* we need to remove the tmp file */
  1237. XX        sprintf(buff, "%s%s", temp_mbox, username);
  1238. XX        if (unlink(buff) != 0) {
  1239. XX          error1(
  1240. XX        "Sorry, but I can't seem to unlink your temp mail file [%s]\n\r",
  1241. XX        error_name(errno));
  1242. XX              silently_exit();
  1243. XX        }
  1244. XX    }
  1245.  
  1246. XX.
  1247. XX108c
  1248. XX        PutLine1(LINES-3,COLUMNS-40,"Mailbox: %s", buff);
  1249. XX.
  1250. XX106c
  1251. XX        PutLine0(LINES-3,COLUMNS-40,"Resynchronizing file");
  1252. XX.
  1253. XX104a
  1254. XX      if (first_word(buff, mailhome)) {    /* a mail file! */
  1255. XX        mbox_specified = 0;       /* fake program to think that */
  1256. XX        stat = 1;                  /*     we're the default file */
  1257. XX        switching_to_default++;      /*        remember this act!  */
  1258. XX      }
  1259.  
  1260. XX.
  1261. XX89,93d
  1262. XX50a
  1263. XX      if (stat == 1 && strlen(infile) == 0) {    
  1264.  
  1265. XX        /* Subtlety - check to see if there's another instantiation
  1266. XX           of Elm (e.g. if the /tmp file is in use).  If so, DIE! */
  1267.  
  1268. XX        sprintf(infile, "%s%s", temp_mbox, username);
  1269. XX        if (access(infile, ACCESS_EXISTS) != -1) {
  1270. XX          error(
  1271. XX        "Hey!  An instantiation of Elm is already reading this mail!\n\r");
  1272. XX              exit(1);
  1273. XX            }
  1274. XX            sprintf(infile, "%s%s", mailhome, username);
  1275. XX      }
  1276. XX.
  1277. XX49a
  1278. XX    if (mbox_specified == 0 && stat == 0)
  1279. XX      switching_from_default++;
  1280.  
  1281. XX.
  1282. XX47c
  1283. XX    int  switching_to_default = 0, switching_from_default = 0;
  1284. XX.
  1285. XX25c
  1286. XXchar *error_name(), *error_description(), *realloc();
  1287. XX.
  1288. XX18c
  1289. XX#  ifndef BSD4.1
  1290. XX#    include <sys/time.h>
  1291. XX#  else
  1292. XX#    include <time.h>
  1293. XX#  endif
  1294. XX.
  1295. XXw
  1296. XXEOF
  1297.  
  1298. XXchars=`cat src/newmbox.c | wc -c`
  1299.  
  1300. XXif [ $chars -ne 11389 ]
  1301. XXthen
  1302. XX  echo Your file src/newmbox.c has been changed\!
  1303. XX  echo diffs saved as \"src/newmbox.D\"
  1304. XXelse
  1305. XX  echo applying diffs to file src/newmbox.c...
  1306. XX  /bin/cat src/newmbox.D | /bin/ed - src/newmbox.c
  1307. XXfi
  1308.  
  1309. XX#-------------------------------------
  1310. XX# File 'src/file_utils.c' diffs...
  1311.  
  1312. XXcat << 'EOF' > src/file_utils.D
  1313. XX124c
  1314. XX    return(stat);
  1315. XX.
  1316. XX119c
  1317. XX#ifdef BSD
  1318. XX    stat = status.w_retcode;
  1319. XX#else
  1320. XX    stat = status;
  1321. XX#endif
  1322. XX.
  1323. XX108,109c
  1324. XX      if ((fd = fopen(file, mode)) == NULL)
  1325. XX        _exit(errno);
  1326. XX      else {
  1327. XX        fclose(fd);        /* don't just LEAVE it! */
  1328. XX        _exit(0);
  1329. XX      }
  1330. XX.
  1331. XX106a
  1332. XX      setuid(userid);        /** back to normal userid **/
  1333. XX.
  1334. XX105d
  1335. XX97c
  1336. XX    FILE *fd;
  1337. XX    int stat = 0, pid, w;
  1338. XX#ifdef BSD
  1339. XX    union wait status;
  1340. XX#else
  1341. XX    int status;
  1342. XX#endif
  1343. XX.
  1344. XX93c
  1345. XX    /** returns 0 iff user can open the file.  This is not
  1346. XX.
  1347. XX85c
  1348. XX    return(stat);
  1349. XX.
  1350. XX80,81c
  1351. XX#ifdef BSD
  1352. XX    stat = status.w_retcode;
  1353. XX#else
  1354. XX    stat = status;
  1355. XX#endif
  1356.  
  1357. XX.
  1358. XX69,70c
  1359.  
  1360. XX      if (access(file, mode) == 0) 
  1361. XX        _exit(0);
  1362. XX      else 
  1363. XX        _exit(errno != 0? errno : 1);    /* never return zero! */
  1364. XX.
  1365. XX67a
  1366. XX      setuid(userid);        /** back to normal userid **/
  1367.  
  1368. XX.
  1369. XX66d
  1370. XX58c
  1371. XX    int stat = 0, pid, w;
  1372. XX#ifdef BSD
  1373. XX    union wait status;
  1374. XX#else
  1375. XX    int status;
  1376. XX#endif
  1377. XX.
  1378. XX56c
  1379. XX    /** returns ZERO iff user can access file or "errno" otherwise **/
  1380. XX.
  1381. XX19a
  1382. XX#ifdef BSD
  1383. XX# include <sys/wait.h>
  1384. XX#endif
  1385.  
  1386. XX.
  1387. XX16a
  1388.  
  1389. XX.
  1390. XX15c
  1391. XX# undef tolower
  1392. XX.
  1393. XXw
  1394. XXEOF
  1395.  
  1396. XXchars=`cat src/file_utils.c | wc -c`
  1397.  
  1398. XXif [ $chars -ne 4640 ]
  1399. XXthen
  1400. XX  echo Your file src/file_utils.c has been changed\!
  1401. XX  echo diffs saved as \"src/file_utils.D\"
  1402. XXelse
  1403. XX  echo applying diffs to file src/file_utils.c...
  1404. XX  /bin/cat src/file_utils.D | /bin/ed - src/file_utils.c
  1405. XXfi
  1406.  
  1407. XX#-------------------------------------
  1408. XX# File 'src/reply.c' diffs...
  1409.  
  1410. XXcat << 'EOF' > src/reply.c.D
  1411. XX362a
  1412. XX}
  1413.  
  1414. XXint
  1415. XXbreak_down_tolist(buf, index, address, comment)
  1416. XXchar *buf, *address, *comment;
  1417. XXint  *index;
  1418. XX{
  1419. XX    /** This routine steps through "buf" and extracts a single address
  1420. XX        entry.  This entry can be of any of the following forms;
  1421.  
  1422. XX        address (name)
  1423. XX        name <address>
  1424. XX        address
  1425. XX    
  1426. XX        Once it's extracted a single entry, it will then return it as
  1427. XX        two tokens, with 'name' (e.g. comment) surrounded by parens.
  1428. XX        Returns ZERO if done with the string...
  1429. XX    **/
  1430.  
  1431. XX    char buffer[LONG_STRING];
  1432. XX    register int i, loc = 0;
  1433.  
  1434. XX    if (*index > strlen(buf)) return(FALSE);
  1435.  
  1436. XX    while (whitespace(buf[*index])) (*index)++;
  1437.  
  1438. XX    if (*index > strlen(buf)) return(FALSE);
  1439.  
  1440. XX    /** Now we're pointing at the first character of the token! **/
  1441.  
  1442. XX    while (buf[*index] != ',' && buf[*index] != '\0')
  1443. XX      buffer[loc++] = buf[(*index)++];
  1444.  
  1445. XX    (*index)++;
  1446.  
  1447. XX    while (whitespace(buffer[loc])) loc--;    /* remove trailing whitespace */
  1448.  
  1449. XX    buffer[loc] = '\0';
  1450.  
  1451. XX    if (strlen(buffer) == 0) return(FALSE);
  1452.  
  1453. XX    dprint1(5, "\n* got \"%s\"\n", buffer);
  1454.  
  1455. XX    if (buffer[loc-1] == ')') {    /*   address (name)  format */
  1456. XX      for (loc = 0;buffer[loc] != '(' && loc < strlen(buffer); loc++)
  1457. XX        /* get to the opening comment character... */ ;
  1458.  
  1459. XX      loc--;    /* back up to just before the paren */
  1460. XX      while (whitespace(buffer[loc])) loc--;    /* back up */
  1461.  
  1462. XX      /** get the address field... **/
  1463.  
  1464. XX      for (i=0; i <= loc; i++)
  1465. XX        address[i] = buffer[i];
  1466. XX      address[i] = '\0';
  1467.  
  1468. XX      /** now get the comment field, en toto! **/
  1469.  
  1470. XX      loc = 0;
  1471.  
  1472. XX      for (i = chloc(buffer, '('); i < strlen(buffer); i++)
  1473. XX        comment[loc++] = buffer[i];
  1474. XX      comment[loc] = '\0';
  1475. XX    }
  1476. XX    else if (buffer[loc-1] == '>') {    /*   name <address>  format */
  1477. XX      dprint0(7, "\tcomment <address>\n");
  1478. XX      for (loc = 0;buffer[loc] != '<' && loc < strlen(buffer); loc++)
  1479. XX        /* get to the opening comment character... */ ;
  1480. XX      while (whitespace(buffer[loc])) loc--;    /* back up */
  1481.  
  1482. XX      /** get the comment field... **/
  1483.  
  1484. XX      comment[0] = '(';
  1485. XX      for (i=1; i < loc; i++)
  1486. XX        comment[i] = buffer[i-1];
  1487. XX      comment[i++] = ')';
  1488. XX      comment[i] = '\0';
  1489.  
  1490. XX      /** now get the address field, en toto! **/
  1491.  
  1492. XX      loc = 0;
  1493.  
  1494. XX      for (i = chloc(buffer,'<') + 1; i < strlen(buffer) - 1; i++)
  1495. XX        address[loc++] = buffer[i];
  1496. XX    
  1497. XX      address[loc] = '\0';
  1498. XX    }
  1499. XX    else {
  1500. XX      strcpy(address, buffer);
  1501. XX      comment[0] = '\0';
  1502. XX    }
  1503.  
  1504. XX    dprint2(5,"-- returning '%s' '%s'\n", address, comment);
  1505.  
  1506. XX    return(TRUE);
  1507. XX.
  1508. XX178a
  1509.  
  1510. XX      if (in_message) dprint1(1,"> %s", buf);
  1511. XX.
  1512. XX175d
  1513. XX170c
  1514. XX      while (break_down_tolist(buf, &index, address, comment)) {
  1515.  
  1516. XX.
  1517. XX168c
  1518. XX      /** we have a buffer with a list of addresses, each of either the
  1519. XX          form "address (name)" or "name <address>".  Our mission, should
  1520. XX          we decide not to be too lazy, is to break it into the two parts.
  1521. XX      **/
  1522. XX          
  1523. XX      if (!whitespace(buf[0]))
  1524. XX        index = chloc(buf, ':')+1;        /* skip header field */
  1525. XX      else
  1526. XX        index = 0;                /* skip whitespace   */
  1527. XX.
  1528. XX135,137c
  1529. XX    char ret_address[LONG_SLEN], buf[LONG_SLEN], new_address[LONG_SLEN],
  1530. XX     address[LONG_SLEN], comment[LONG_SLEN];
  1531. XX    char *bufptr;
  1532. XX    int  in_message = 1, first_pass = 0, index;
  1533. XX.
  1534. XXw
  1535. XXEOF
  1536.  
  1537. XXchars=`cat src/reply.c | wc -c`
  1538.  
  1539. XXif [ $chars -ne 10560 ]
  1540. XXthen
  1541. XX  echo Your file src/reply.c has been changed\!
  1542. XX  echo diffs saved as \"src/reply.c.D\"
  1543. XXelse
  1544. XX  echo applying diffs to file src/reply.c...
  1545. XX  /bin/cat src/reply.c.D | /bin/ed - src/reply.c
  1546. XXfi
  1547.  
  1548. XX#-------------------------------------
  1549. XX# File 'src/screen.c' diffs...
  1550.  
  1551. XXcat << 'EOF' > src/screen.c.D
  1552. XX245c
  1553. XX        (highlight && has_highlighting && !arrow_cursor) ?
  1554. XX              end_highlight : "");
  1555. XX.
  1556. XX230,231c
  1557. XX        highlight? ((has_highlighting && !arrow_cursor) ?
  1558. XX                   start_highlight : "->") : "  ",
  1559. XX        (highlight && has_highlighting && !arrow_cursor)? "  " : "",
  1560. XX.
  1561. XXw
  1562. XXEOF
  1563.  
  1564. XXchars=`cat src/screen.c | wc -c`
  1565.  
  1566. XXif [ $chars -ne 7956 ]
  1567. XXthen
  1568. XX  echo Your file src/screen.c has been changed\!
  1569. XX  echo diffs saved as \"src/screen.c.D\"
  1570. XXelse
  1571. XX  echo applying diffs to file src/screen.c...
  1572. XX  /bin/cat src/screen.c.D | /bin/ed - src/screen.c
  1573. XXfi
  1574.  
  1575. XX#-------------------------------------
  1576. XX# File 'src/strings.c' diffs...
  1577.  
  1578. XXcat << 'EOF' > src/strings.D
  1579. XX167c
  1580. XX        current_length += strlen(word);
  1581. XX.
  1582. XX165c
  1583. XX          current_length += 2;
  1584. XX        }
  1585. XX        for (i=(word[0] == ' '? 1:0); i<strlen(word); i++)
  1586. XX.
  1587. XX162,163c
  1588.  
  1589. XX      else {    /* just add this address to the list.. */
  1590.  
  1591. XX        if (index > 0) {
  1592. XX          ret_buffer[index++] = ',';    /* comma added! */
  1593. XX.
  1594. XX158c
  1595. XX        
  1596. XX        /* now add this pup! */
  1597.  
  1598. XX        for (i=(word[0] == ' '? 1:0); i<strlen(word); i++)
  1599. XX.
  1600. XX152a
  1601. XX          ret_buffer[index++] = ',';    /* close 'er up, doctor! */
  1602. XX.
  1603. XX150c
  1604. XX    while ((word = get_token(bufptr,",", depth)) != NULL) {
  1605.  
  1606. XX        /* first, decide what sort of separator we need, if any... */
  1607.  
  1608. XX.
  1609. XX131,136c
  1610. XX    /** Return buffer with \n\t sequences added at each point where it 
  1611. XX        would be more than 80 chars long.  It only allows the breaks at 
  1612. XX        legal points (ie commas followed by white spaces).  init-len is 
  1613. XX        the characters already on the first line...  Changed so that if 
  1614. XX            this is called while mailing without the overhead of "elm", it'll 
  1615. XX            include "\r\n\t" instead.
  1616. XX        Changed to use ',' as a separator and to REPLACE it after it's
  1617. XX        found in the output stream...
  1618. XX.
  1619. XXw
  1620. XXEOF
  1621.  
  1622. XXchars=`cat src/strings.c | wc -c`
  1623.  
  1624. XXif [ $chars -ne 10842 ]
  1625. XXthen
  1626. XX  echo Your file src/strings.c has been changed\!
  1627. XX  echo diffs saved as \"src/strings.D\"
  1628. XXelse
  1629. XX  echo applying diffs to file src/strings.c...
  1630. XX  /bin/cat src/strings.D | /bin/ed - src/strings.c
  1631. XXfi
  1632.  
  1633. XX#-------------------------------------
  1634. XX# File 'src/utils.c' diffs...
  1635.  
  1636. XXcat << 'EOF' > src/utils.c.D
  1637. XX68a
  1638. XX    (void) unlink(buffer);
  1639.  
  1640. XX    if (! mail_only) {
  1641. XX      MoveCursor(LINES,0);
  1642. XX      Writechar('\n');
  1643. XX    }
  1644.  
  1645. XX    exit(0);
  1646. XX}
  1647.  
  1648. XXsilently_exit()
  1649. XX{
  1650. XX    /** This is the same as 'leave', but it doesn't remove any non-pid
  1651. XX        files.  It's used when we notice that we're trying to create a
  1652. XX        temp mail file and one already exists!!
  1653. XX    **/
  1654. XX    char buffer[SLEN];
  1655.  
  1656. XX    dprint0(2,"\nLeaving mailer quietly (silently_exit)\n");
  1657.  
  1658. XX    Raw(OFF);
  1659. XX    if (cursor_control)  transmit_functions(OFF);
  1660. XX    if (hp_terminal)     softkeys_off();
  1661.  
  1662. XX    sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
  1663. XX    (void) unlink(buffer);
  1664.  
  1665. XX    sprintf(buffer,"%s%d",temp_file, getpid()+1);  /* editor buffer */
  1666. XX.
  1667. XX18a
  1668. XXextern int errno;
  1669. XXchar *error_name();
  1670.  
  1671. XXshow_mailfile_stats()
  1672. XX{
  1673. XX    /** when we're about to die, let's try to dump lots of good stuff
  1674. XX        to the debug file... **/
  1675.  
  1676. XX    struct stat buffer;
  1677.  
  1678. XX    if (debug == 0) return;        /* Damn!  Can't do it! */
  1679.  
  1680. XX    if (fstat(fileno(mailfile), &buffer) == 0) {
  1681. XX      dprint1(1,"\nDump of stats for mailfile %s;\n", infile);
  1682.  
  1683. XX      dprint3(1, "\tinode: %d, mode: %o, uid: %d, ",
  1684. XX            buffer.st_ino, buffer.st_mode, buffer.st_uid);
  1685. XX      dprint2(1,"gid: %d, size: %d\n\n", buffer.st_gid, buffer.st_size);
  1686.  
  1687. XX      dprint1(1,"\toffset into file = %l\n", ftell(mailfile));
  1688. XX    }
  1689. XX    else
  1690. XX      dprint2(1,"\nfstat on mailfile '%s' failed with error %s!!\n\n",
  1691. XX            infile, error_name(errno));
  1692. XX}
  1693. XX    
  1694. XX.
  1695. XX11a
  1696. XX#include <errno.h>
  1697. XX.
  1698. XXw
  1699. XXEOF
  1700.  
  1701. XXchars=`cat src/utils.c | wc -c`
  1702.  
  1703. XXif [ $chars -ne 3786 ]
  1704. XXthen
  1705. XX  echo Your file src/utils.c has been changed\!
  1706. XX  echo diffs saved as \"src/utils.c.D\"
  1707. XXelse
  1708. XX  echo applying diffs to file src/utils.c...
  1709. XX  /bin/cat src/utils.c.D | /bin/ed - src/utils.c
  1710. XXfi
  1711.  
  1712. XX#-------------------------------------
  1713. XX# File 'src/syscall.c' diffs...
  1714.  
  1715. XXcat << 'EOF' > src/syscall.D
  1716. XX91c
  1717. XX    return(stat);
  1718. XX.
  1719. XX86c
  1720. XX#ifdef BSD
  1721. XX    if (status.w_retcode != 0) stat = status.w_retcode;
  1722. XX#else
  1723. XX    if (w == -1) stat = status;
  1724. XX#endif
  1725. XX.
  1726. XX76c
  1727. XX        execl("/bin/sh", "sh", "-c", string, (char *) 0);
  1728. XX.
  1729. XX73c
  1730. XX        execl(shell, argv_zero(shell), "-c", string, (char *) 0);
  1731. XX.
  1732. XX70a
  1733. XX      setuid(userid);    /* back to the normal user! */
  1734. XX.
  1735. XX69d
  1736. XX58c
  1737. XX    int stat = 0, pid, w;
  1738. XX#ifdef BSD
  1739. XX    union wait status;
  1740. XX#else
  1741. XX    int status;
  1742. XX#endif
  1743. XX.
  1744. XX12a
  1745. XX#ifdef BSD
  1746. XX#  include <sys/wait.h>
  1747. XX#endif
  1748.  
  1749. XX.
  1750. XXw
  1751. XXEOF
  1752.  
  1753. XXchars=`cat src/syscall.c | wc -c`
  1754.  
  1755. XXif [ $chars -ne 4692 ]
  1756. XXthen
  1757. XX  echo Your file src/syscall.c has been changed\!
  1758. XX  echo diffs saved as \"src/syscall.D\"
  1759. XXelse
  1760. XX  echo applying diffs to file src/syscall.c...
  1761. XX  /bin/cat src/syscall.D | /bin/ed - src/syscall.c
  1762. XXfi
  1763.  
  1764. XX#-------------------------------------
  1765. XX# File 'src/aliaslib.c' diffs...
  1766.  
  1767. XXcat << 'EOF' > src/aliaslib.D
  1768. XX159c
  1769. XX    /* Read from file fd.  End read upon reading either 
  1770. XX.
  1771. XXw
  1772. XXEOF
  1773.  
  1774. XXchars=`cat src/aliaslib.c | wc -c`
  1775.  
  1776. XXif [ $chars -ne 4476 ]
  1777. XXthen
  1778. XX  echo Your file src/aliaslib.c has been changed\!
  1779. XX  echo diffs saved as \"src/aliaslib.D\"
  1780. XXelse
  1781. XX  echo applying diffs to file src/aliaslib.c...
  1782. XX  /bin/cat src/aliaslib.D | /bin/ed - src/aliaslib.c
  1783. XXfi
  1784.  
  1785. XX#-------------------------------------
  1786. XX# File 'src/domains.c' diffs...
  1787.  
  1788. XXcat << 'EOF' > src/domains.D
  1789. XX16a
  1790. XX#ifdef BSD
  1791. XX# undef toupper
  1792. XX# undef tolower
  1793. XX#endif
  1794.  
  1795. XX.
  1796. XXw
  1797. XXEOF
  1798.  
  1799. XXchars=`cat src/domains.c | wc -c`
  1800.  
  1801. XXif [ $chars -ne 7635 ]
  1802. XXthen
  1803. XX  echo Your file src/domains.c has been changed\!
  1804. XX  echo diffs saved as \"src/domains.D\"
  1805. XXelse
  1806. XX  echo applying diffs to file src/domains.c...
  1807. XX  /bin/cat src/domains.D | /bin/ed - src/domains.c
  1808. XXfi
  1809.  
  1810. XX#-------------------------------------
  1811. XX# File 'src/fileio.c' diffs...
  1812.  
  1813. XXcat << 'EOF' > src/fileio.c.D
  1814. XX64a
  1815.  
  1816. XX#ifdef SITE_HIDING
  1817.  
  1818. XXint
  1819. XXis_a_hidden_user(username)
  1820. XXchar *username;
  1821. XX{
  1822. XX    /** Returns true iff the username is present in the list of
  1823. XX       'hidden users' on the system.
  1824. XX    **/
  1825. XX    
  1826. XX    FILE *hidden_users;
  1827. XX    char  buffer[SLEN];
  1828.  
  1829. XX    if ((hidden_users = fopen (HIDDEN_SITE_USERS,"r")) == NULL) {
  1830. XX      dprint2(1,"Couldn't open hidden site file %s [%s]\n",
  1831. XX          HIDDEN_SITE_USERS, error_name(errno));
  1832. XX      return(FALSE);
  1833. XX    }
  1834.  
  1835. XX    while (fscanf(hidden_users, "%s", buffer) != EOF)
  1836. XX      if (strcmp(buffer, username) == 0) {
  1837. XX        dprint1(3,"** Found user '%s' in hidden site file!\n",
  1838. XX            username);
  1839. XX        fclose(hidden_users);
  1840. XX        return(TRUE);
  1841. XX      }
  1842.  
  1843. XX    fclose(hidden_users);
  1844. XX    dprint1(3,"** Couldn't find user '%s' in hidden site file!\n",
  1845. XX        username);
  1846.  
  1847. XX    return(FALSE);
  1848. XX}
  1849.  
  1850. XX#endif
  1851. XX.
  1852. XX59a
  1853. XX        ok = 0;    /* STOP NOW! */
  1854. XX.
  1855. XX14a
  1856. XXextern int errno;
  1857.  
  1858. XXchar *error_name();
  1859.  
  1860. XX.
  1861. XX9a
  1862. XX#include <errno.h>
  1863. XX.
  1864. XXw
  1865. XXEOF
  1866.  
  1867. XXchars=`cat src/fileio.c | wc -c`
  1868.  
  1869. XXif [ $chars -ne 1967 ]
  1870. XXthen
  1871. XX  echo Your file src/fileio.c has been changed\!
  1872. XX  echo diffs saved as \"src/fileio.c.D\"
  1873. XXelse
  1874. XX  echo applying diffs to file src/fileio.c...
  1875. XX  /bin/cat src/fileio.c.D | /bin/ed - src/fileio.c
  1876. XXfi
  1877.  
  1878. XX#-------------------------------------
  1879. XX# File 'src/return_addr.c' diffs...
  1880.  
  1881. XXcat << 'EOF' > src/return_addr.D
  1882. XX282a
  1883. XX    else {
  1884. XX       /* if we have a space character, or we DON'T have '!' or '@' chars */
  1885.  
  1886. XX       if (chloc(header_table[current-1].from, ' ') >= 0 ||
  1887. XX       (chloc(header_table[current-1].from, '!') < 0 &&
  1888. XX        chloc(header_table[current-1].from, '@') < 0))
  1889.  
  1890. XX     sprintf(name2, " (%s)", header_table[current-1].from);
  1891. XX     strcat(buffer, name2);
  1892. XX    }
  1893.  
  1894. XX.
  1895. XX229a
  1896. XX    /* now initialize all the char buffers [thanks Keith!] */
  1897.  
  1898. XX    buf[0] = name1[0] = name2[0] = lastname[0] = '\0';
  1899. XX    hold_return[0] = alt_name2[0] = '\0';
  1900.  
  1901. XX.
  1902. XXw
  1903. XXEOF
  1904.  
  1905. XXchars=`cat src/return_addr.c | wc -c`
  1906.  
  1907. XXif [ $chars -ne 9321 ]
  1908. XXthen
  1909. XX  echo Your file src/return_addr.c has been changed\!
  1910. XX  echo diffs saved as \"src/return_addr.D\"
  1911. XXelse
  1912. XX  echo applying diffs to file src/return_addr.c...
  1913. XX  /bin/cat src/return_addr.D | /bin/ed - src/return_addr.c
  1914. XXfi
  1915.  
  1916. XX#-------------------------------------
  1917. XX# File 'src/addr_utils.c' diffs...
  1918.  
  1919. XXcat << 'EOF' > src/addr_utils.D
  1920. XX219c
  1921.  
  1922. XX          if (mail_only) 
  1923. XX            printf(buffer);
  1924. XX          else
  1925. XX.
  1926. XXw
  1927. XXEOF
  1928.  
  1929. XXchars=`cat src/addr_utils.c | wc -c`
  1930.  
  1931. XXif [ $chars -ne 15408 ]
  1932. XXthen
  1933. XX  echo Your file src/addr_utils.c has been changed\!
  1934. XX  echo diffs saved as \"src/addr_utils.D\"
  1935. XXelse
  1936. XX  echo applying diffs to file src/addr_utils.c...
  1937. XX  /bin/cat src/addr_utils.D | /bin/ed - src/addr_utils.c
  1938. XXfi
  1939.  
  1940. XX#-------------------------------------
  1941. XX# File 'src/input_utils.c' diffs...
  1942.  
  1943. XXcat << 'EOF' > src/input_utils.D
  1944. XX85c
  1945. XX    if (! append_current && ! mail_only)
  1946. XX.
  1947. XX83c
  1948. XX    if (!mail_only)
  1949. XX      PutLine1(x,y, "%s", string);    
  1950. XX    else
  1951. XX      printf("%s", string);    
  1952.  
  1953. XX.
  1954. XXw
  1955. XXEOF
  1956.  
  1957. XXchars=`cat src/input_utils.c | wc -c`
  1958.  
  1959. XXif [ $chars -ne 7235 ]
  1960. XXthen
  1961. XX  echo Your file src/input_utils.c has been changed\!
  1962. XX  echo diffs saved as \"src/input_utils.D\"
  1963. XXelse
  1964. XX  echo applying diffs to file src/input_utils.c...
  1965. XX  /bin/cat src/input_utils.D | /bin/ed - src/input_utils.c
  1966. XXfi
  1967.  
  1968. XX#-------------------------------------
  1969. XX# File 'src/mailtime.c' diffs...
  1970.  
  1971. XXcat << 'EOF' > src/mailtime.D
  1972. XX117a
  1973. XX    /** That's what I like about programming for BSD & USG - the easy
  1974. XX        portability between 'em.  Especially the section 2 calls!! **/
  1975.  
  1976. XX.
  1977. XX116c
  1978. XX    if (utime(filename, NULL) == -1)    /* note no "S"  */
  1979. XX.
  1980. XX114c
  1981. XX    if (utimes(filename, &tval) == -1)    /* note the "S" */
  1982. XX# endif
  1983. XX.
  1984. XX110a
  1985. XX# ifdef BSD4.1
  1986. XX    tval = (time_t) time((long *) 0);
  1987. XX    if (utime(filename, &tval) == -1)
  1988. XX# else
  1989. XX.
  1990. XX105a
  1991. XX# endif
  1992. XX.
  1993. XX103a
  1994. XX# ifdef BSD4.1
  1995. XX    struct timeb  loc_time;
  1996. XX    time_t tval;
  1997. XX# else
  1998. XX.
  1999. XX73a
  2000. XX#ifdef BSD
  2001. XX    extern struct tm *localtime();
  2002. XX#endif
  2003. XX.
  2004. XX14c
  2005. XX#  ifndef BSD4.1
  2006. XX#    include <sys/time.h>
  2007. XX#  else
  2008. XX#    include <time.h>
  2009. XX#    include <sys/timeb.h>
  2010. XX#  endif
  2011. XX.
  2012. XXw
  2013. XXEOF
  2014.  
  2015. XXchars=`cat src/mailtime.c | wc -c`
  2016.  
  2017. XXif [ $chars -ne 4271 ]
  2018. XXthen
  2019. XX  echo Your file src/mailtime.c has been changed\!
  2020. XX  echo diffs saved as \"src/mailtime.D\"
  2021. XXelse
  2022. XX  echo applying diffs to file src/mailtime.c...
  2023. XX  /bin/cat src/mailtime.D | /bin/ed - src/mailtime.c
  2024. XXfi
  2025.  
  2026. XX#-------------------------------------
  2027. XX# File 'src/opt_utils.c' diffs...
  2028.  
  2029. XXcat << 'EOF' > src/opt_utils.D
  2030. XX38a
  2031.  
  2032. XX#endif
  2033.  
  2034. XX#ifdef UTS
  2035. XX.
  2036. XX20c
  2037. XX#ifdef NEED_GETHOSTNAME
  2038. XX.
  2039. XX17,18c
  2040. XX# include <sys/tubio.h>
  2041. XX# define  TTYIN        0        /* standard input */
  2042. XX#endif
  2043. XX.
  2044. XX13c
  2045. XX# include <pwd.h>
  2046. XX#else
  2047. XX# include <sys/utsname.h>
  2048. XX.
  2049. XXw
  2050. XXEOF
  2051.  
  2052. XXchars=`cat src/opt_utils.c | wc -c`
  2053.  
  2054. XXif [ $chars -ne 4997 ]
  2055. XXthen
  2056. XX  echo Your file src/opt_utils.c has been changed\!
  2057. XX  echo diffs saved as \"src/opt_utils.D\"
  2058. XXelse
  2059. XX  echo applying diffs to file src/opt_utils.c...
  2060. XX  /bin/cat src/opt_utils.D | /bin/ed - src/opt_utils.c
  2061. XXfi
  2062.  
  2063. XX#-------------------------------------
  2064. XX# File 'src/mailmsg2.c' diffs...
  2065.  
  2066. XXcat << 'EOF' > src/mailmsg2.D
  2067. XX405,406c
  2068. XX    fprintf(filedesc,"From: %s <%s!%s>\n", full_username,
  2069. XX        hostname, username);
  2070. XX.
  2071. XX401,402c
  2072. XX    fprintf(filedesc,"From: %s <%s@%s>\n", full_username,
  2073. XX        username, hostname);
  2074. XX.
  2075. XX398,399c
  2076. XX    fprintf(filedesc,"From: %s <%s@%s%s>\n", full_username, 
  2077. XX        username, hostname, DOMAIN);
  2078. XX.
  2079. XX395a
  2080. XX# ifdef SITE_HIDING
  2081. XX    if (is_a_hidden_user(username))
  2082. XX      fprintf(filedesc,"From: %s <%s!%s!%s>\n", full_username,
  2083. XX          hostname, HIDDEN_SITE_NAME, username);
  2084. XX    else
  2085. XX# endif
  2086. XX.
  2087. XX390a
  2088. XX#ifdef SITE_HIDING
  2089. XX    if (is_a_hidden_user(username)) {
  2090. XX      /** this is the interesting part of this trick... **/
  2091. XX      sprintf(buffer, "From %s!%s %s\n",  HIDDEN_SITE_NAME,
  2092. XX          username, get_ctime_date());
  2093. XX      fprintf(filedesc, "%s", buffer);
  2094. XX      dprint1(1,"\nadded: %s", buffer);
  2095. XX      /** so is this perverted or what? **/
  2096. XX    }
  2097. XX#endif
  2098.  
  2099. XX.
  2100. XX313c
  2101. XX          printf("No\n\r\n\r");
  2102. XX          /** try to save it as a dead letter file **/
  2103. XX          
  2104. XX          sprintf(fname, "%s/%s", home, dead_letter);
  2105.  
  2106. XX          if ((deadfd = fopen(fname,"a")) == NULL) {
  2107. XX        dprint2(1,
  2108. XX            "\nAttempt to append to deadletter file '%s' failed: %s\n",
  2109. XX            fname, error_name(errno));
  2110. XX            printf("Message not saved, Sorry.\n\r\n\r");
  2111. XX        return('f');
  2112. XX          }
  2113. XX          else if ((messagefd = fopen(filename, "r")) == NULL) {
  2114. XX        dprint2(1,"\nAttempt to read reply file '%s' failed: %s\n",
  2115. XX            filename, error_name(errno));
  2116. XX            printf("Message not saved, Sorry.\n\r\n\r");
  2117. XX        return('f');
  2118. XX          }
  2119. XX    
  2120. XX          /* if we get here we're okay for everything, right? */
  2121.  
  2122. XX          while (fgets(buffer, LONG_SLEN, messagefd) != NULL)
  2123. XX        fputs(buffer, deadfd);
  2124.  
  2125. XX          fclose(messagefd);
  2126. XX          fclose(deadfd);
  2127.  
  2128. XX          printf("Message saved in file \"$HOME/%s\"\n\n", dead_letter);
  2129.  
  2130. XX.
  2131. XX303c
  2132. XX    FILE *deadfd, *messagefd;
  2133. XX    char ch, buffer[LONG_SLEN], fname[SLEN];
  2134. XX.
  2135. XX301c
  2136. XX        TRUE if everything is okay, FALSE if cancelled.  Modified
  2137. XX        compliments of Steve Wolf to add the'dead.letter' feature **/
  2138. XX.
  2139. XX298c
  2140. XXverify_transmission(filename)
  2141. XXchar *filename;
  2142. XX.
  2143. XX199c
  2144. XX                  mailer, strip_parens(strip_commas(expanded_to)), 
  2145. XX.
  2146. XX195c
  2147. XX                  sendmail, smflags, strip_parens(strip_commas(expanded_to)), 
  2148. XX.
  2149. XX193c
  2150. XX      if (access(sendmail, EXECUTE_ACCESS) == 0 
  2151. XX#ifdef SITE_HIDING
  2152. XX          && ! is_a_hidden_user(username))
  2153. XX#else
  2154. XX         )
  2155. XX#endif
  2156. XX.
  2157. XX178c
  2158. XX                  mailx, subject, strip_parens(strip_commas(expanded_to)), 
  2159. XX.
  2160. XX155c
  2161. XX    if (auto_cc && !batch) 
  2162. XX.
  2163. XX139,140c
  2164. XX      error1("Could not open reply file (%s)", error_name(errno));
  2165. XX      return(1);
  2166. XX.
  2167. XX136c
  2168. XX      dprint2(1,
  2169. XX.
  2170. XX133a
  2171.  
  2172. XX      if ((reply = fopen(filename,"r")) == NULL) {
  2173. XX          dprint2(1,
  2174. XX        "Attempt to open file %s for reading failed with error %s (mail)\n",
  2175. XX                filename, error_name(errno));
  2176. XX          error1("Could not open reply file (%s)", error_name(errno));
  2177. XX          return(1);
  2178. XX      }
  2179. XX.
  2180. XX129c
  2181. XX        if ((ch = verify_transmission(filename)) == 'f') {    /* cancelled! */
  2182. XX.
  2183. XX124a
  2184. XX           default : /* do nothing */ ;
  2185. XX.
  2186. XX121c
  2187. XX******************************************************************************/
  2188. XX.
  2189. XX112c
  2190. XX/*****************************************************************************
  2191. XX          case 'e' : if (edit_message) edit_the_message(filename);
  2192. XX                   /** now let's try reading it again... 
  2193.  
  2194. XX               (void) fclose(reply);    /* make sure it's closed
  2195. XX.
  2196. XX110c
  2197. XX          case 'e' : edit_the_message(filename);    break;
  2198. XX.
  2199. XX108d
  2200. XX103c
  2201. XX    ch = edit_message? 'e' : ' ';    /* drop through if needed... */
  2202. XX.
  2203. XX78c
  2204. XX        fprintf(reply, "%s\n", very_long_buffer);
  2205. XX.
  2206. XX75d
  2207. XX71d
  2208. XX40c
  2209. XX    char ch;
  2210. XX.
  2211. XX14c
  2212. XXchar *format_long(), *strip_commas(), *tail_of_string(); 
  2213. XX#ifdef SITE_HIDING 
  2214. XX char *get_ctime_date();
  2215. XX#endif
  2216. XX.
  2217. XXw
  2218. XXEOF
  2219.  
  2220. XXchars=`cat src/mailmsg2.c | wc -c`
  2221.  
  2222. XXif [ $chars -ne 14200 ]
  2223. XXthen
  2224. XX  echo Your file src/mailmsg2.c has been changed\!
  2225. XX  echo diffs saved as \"src/mailmsg2.D\"
  2226. XXelse
  2227. XX  echo applying diffs to file src/mailmsg2.c...
  2228. XX  /bin/cat src/mailmsg2.D | /bin/ed - src/mailmsg2.c
  2229. XXfi
  2230.  
  2231. XX#-------------------------------------
  2232. XX# File 'src/savecopy.c' diffs...
  2233.  
  2234. XXcat << 'EOF' > src/savecopy.D
  2235. XX100c
  2236. XX    thetime = (long) time((long *) 0);      /* dumb dumb dumb routine */
  2237. XX.
  2238. XX52c
  2239. XX        if (can_access(savename, READ_ACCESS) != 0)
  2240. XX.
  2241. XX10a
  2242. XX# endif
  2243. XX.
  2244. XX9a
  2245. XX# ifdef BSD4.1
  2246. XX#  include <time.h>
  2247. XX# else
  2248. XX.
  2249. XXw
  2250. XXEOF
  2251.  
  2252. XXchars=`cat src/savecopy.c | wc -c`
  2253.  
  2254. XXif [ $chars -ne 4059 ]
  2255. XXthen
  2256. XX  echo Your file src/savecopy.c has been changed\!
  2257. XX  echo diffs saved as \"src/savecopy.D\"
  2258. XXelse
  2259. XX  echo applying diffs to file src/savecopy.c...
  2260. XX  /bin/cat src/savecopy.D | /bin/ed - src/savecopy.c
  2261. XXfi
  2262.  
  2263. XX#-------------------------------------
  2264. XX# File 'src/mailmsg1.c' diffs...
  2265.  
  2266. XXcat << 'EOF' > src/mailmsg1.D
  2267. XX245c
  2268. XX      printf("To: %s\n\r", format_long(address, 3));
  2269. XX.
  2270. XXw
  2271. XXEOF
  2272.  
  2273. XXchars=`cat src/mailmsg1.c | wc -c`
  2274.  
  2275. XXif [ $chars -ne 6587 ]
  2276. XXthen
  2277. XX  echo Your file src/mailmsg1.c has been changed\!
  2278. XX  echo diffs saved as \"src/mailmsg1.D\"
  2279. XXelse
  2280. XX  echo applying diffs to file src/mailmsg1.c...
  2281. XX  /bin/cat src/mailmsg1.D | /bin/ed - src/mailmsg1.c
  2282. XXfi
  2283.  
  2284. XX#-------------------------------------
  2285. XX# File 'src/connect_to.c' diffs...
  2286.  
  2287. XXcat << 'EOF' > src/connect_to.D
  2288. XX128c
  2289. XX        system_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
  2290. XX.
  2291. XX115c
  2292. XX        previous_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
  2293. XX.
  2294. XX61c
  2295. XX        system_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
  2296. XX.
  2297. XX48c
  2298. XX        previous_record = (struct lsys_rec *) pmalloc(sizeof *talk_to_sys);
  2299. XX.
  2300. XX13a
  2301. XXchar *pmalloc();
  2302.  
  2303. XX.
  2304. XXw
  2305. XXEOF
  2306.  
  2307. XXchars=`cat src/connect_to.c | wc -c`
  2308.  
  2309. XXif [ $chars -ne 3887 ]
  2310. XXthen
  2311. XX  echo Your file src/connect_to.c has been changed\!
  2312. XX  echo diffs saved as \"src/connect_to.D\"
  2313. XXelse
  2314. XX  echo applying diffs to file src/connect_to.c...
  2315. XX  /bin/cat src/connect_to.D | /bin/ed - src/connect_to.c
  2316. XXfi
  2317.  
  2318. XX#-------------------------------------
  2319. XX# File 'src/errno.c' diffs...
  2320.  
  2321. XXcat << 'EOF' > src/errno.c.D
  2322. XX74,75d
  2323. XX60,61d
  2324. XXw
  2325. XXEOF
  2326.  
  2327. XXchars=`cat src/errno.c | wc -c`
  2328.  
  2329. XXif [ $chars -ne 2612 ]
  2330. XXthen
  2331. XX  echo Your file src/errno.c has been changed\!
  2332. XX  echo diffs saved as \"src/errno.c.D\"
  2333. XXelse
  2334. XX  echo applying diffs to file src/errno.c...
  2335. XX  /bin/cat src/errno.c.D | /bin/ed - src/errno.c
  2336. XXfi
  2337.  
  2338. XX#-------------------------------------
  2339. XX# File 'src/options.c' diffs...
  2340.  
  2341. XXcat << 'EOF' > src/options.D
  2342. XX52c
  2343. XX  "This is the program invoked to display individual messages (try 'builtin')");
  2344. XX.
  2345. XXw
  2346. XXEOF
  2347.  
  2348. XXchars=`cat src/options.c | wc -c`
  2349.  
  2350. XXif [ $chars -ne 7702 ]
  2351. XXthen
  2352. XX  echo Your file src/options.c has been changed\!
  2353. XX  echo diffs saved as \"src/options.D\"
  2354. XXelse
  2355. XX  echo applying diffs to file src/options.c...
  2356. XX  /bin/cat src/options.D | /bin/ed - src/options.c
  2357. XXfi
  2358.  
  2359. XX#-------------------------------------
  2360. XX# File 'src/elm.c' diffs...
  2361.  
  2362. XXcat << 'EOF' > src/elm.c.D
  2363. XX105c
  2364. XX               if (move_when_paged && header_page >= 0)
  2365. XX.
  2366. XX100c
  2367. XX                   header_page <=(message_count / headers_per_page))
  2368. XX.
  2369. XX34c
  2370. XX           format_long(to_whom, 3));
  2371. XX.
  2372. XX31a
  2373. XX#ifdef BSD4.1
  2374. XX       initscr();
  2375. XX#endif
  2376.  
  2377. XX.
  2378. XX27a
  2379. XX#ifdef BSD
  2380. XX    InitScreen();
  2381. XX#endif
  2382.  
  2383. XX.
  2384. XX10a
  2385. XX#ifdef BSD
  2386. XX# undef toupper
  2387. XX# undef tolower
  2388. XX#endif
  2389.  
  2390. XX.
  2391. XXw
  2392. XXEOF
  2393.  
  2394. XXchars=`cat src/elm.c | wc -c`
  2395.  
  2396. XXif [ $chars -ne 15852 ]
  2397. XXthen
  2398. XX  echo Your file src/elm.c has been changed\!
  2399. XX  echo diffs saved as \"src/elm.c.D\"
  2400. XXelse
  2401. XX  echo applying diffs to file src/elm.c...
  2402. XX  /bin/cat src/elm.c.D | /bin/ed - src/elm.c
  2403. XXfi
  2404.  
  2405. XX#---------------------------------
  2406. XX# File Elm/src/builtin.c is new!
  2407.  
  2408. XXecho File Elm/src/builtin.c is new - extracting...
  2409. XXif [ -f src/builtin.c ]
  2410. XXthen
  2411. XX  echo File \'src/builtin.c\' is new, but you already have something called that\!
  2412. XX  echo I\'m going to move your file to \'src/builtin.c.old\'...
  2413. XX  /bin/mv -f src/builtin.c src/builtin.c.old
  2414. XXelse
  2415. XX  echo Extracting new file \'src/builtin.c\'
  2416. XXfi
  2417.  
  2418. XXcat > src/builtin.c << 'END_OF_FILE'
  2419. XX/**            builtin.c        **/
  2420.  
  2421. XX/** This is the built-in pager for displaying messages while in the Elm
  2422. XX    program.  It's a bare-bones pager with precious few options. The idea
  2423. XX    is that those systems that are sufficiently slow that using an external
  2424. XX    pager such as 'more' is too slow, then they can use this!
  2425.  
  2426. XX    (C) Copyright 1986, Dave Taylor
  2427. XX**/
  2428.  
  2429. XX#include "headers.h"
  2430. XX#include <ctype.h>
  2431.  
  2432. XX#define  BEEP        007        /* ASCII Bell character */
  2433.  
  2434. XX#ifdef BSD
  2435. XX#  undef tolower
  2436. XX#endif
  2437.  
  2438. XXint    lines_put_on_screen = 0,    /* number of lines displayed per screen */
  2439. XX    lines_displayed = 0,        /* Total number of lines displayed      */
  2440. XX    total_lines_to_display;        /* total number of lines in message     */
  2441.  
  2442. XXstart_builtin(lines_in_message)
  2443. XXint lines_in_message;
  2444. XX{
  2445. XX    /** clears that screen and resets it's internal counters... **/
  2446.  
  2447. XX    dprint1(8,"displaying %d lines from message using internal pager\n",
  2448. XX        lines_in_message);
  2449.  
  2450. XX    lines_displayed = 0;
  2451. XX    lines_put_on_screen = 0;
  2452.  
  2453. XX    total_lines_to_display = lines_in_message;
  2454. XX}
  2455.  
  2456. XXint
  2457. XXdisplay_line(line)
  2458. XXchar *line;
  2459. XX{
  2460. XX    /** Display the given line on the screen, taking into account such
  2461. XX        dumbness as wraparound and such.  If displaying this would put
  2462. XX        us at the end of the screen, put out the "MORE" prompt and wait
  2463. XX        for some input.   Return non-zero if the user terminates the
  2464. XX        paging (e.g. 'q') or zero if we should continue...
  2465. XX    **/
  2466. XX    
  2467. XX    register int lines_needed, okay_char, ch;
  2468.  
  2469. XX    lines_needed = (int) (printable_chars(line) / COLUMNS);    /* wraparound */
  2470.  
  2471. XX    for (ch = 0; ch < strlen(line); ch++)
  2472. XX      if (line[ch] == '\n') lines_needed++;
  2473.  
  2474. XX    dprint1(6,"* display-line \"%s\"\n", line);
  2475. XX    dprint2(7,"**  at line %d of the screen (%d available)\n",
  2476. XX         lines_put_on_screen, LINES-1);
  2477.  
  2478. XX    if (lines_needed + lines_put_on_screen > LINES-1) {
  2479. XX      dprint2(9,"** need CR: lines on screen = %d, need %d\n", lines_needed,
  2480. XX          lines_put_on_screen);
  2481. XX      StartBold();
  2482. XX      Write_to_screen(" More (%d%%)", 1, 
  2483. XX        (int) (100.0 * (
  2484. XX           (float) lines_displayed / (float) total_lines_to_display)));
  2485. XX      EndBold();
  2486. XX      okay_char = FALSE;
  2487. XX      do {
  2488. XX         Raw(ON);
  2489. XX         ch =  tolower(ReadCh());
  2490. XX         Raw(OFF);
  2491. XX         switch (ch) {
  2492. XX           case '\n' : 
  2493. XX           case '\r' : /* <return> pressed... */
  2494. XX               lines_put_on_screen -= lines_needed;
  2495. XX               okay_char = TRUE;
  2496. XX               break;
  2497. XX           case ' '  : /* <space> pressed... */
  2498. XX               lines_put_on_screen = 0;
  2499. XX               okay_char = TRUE;
  2500. XX               break;
  2501. XX           case 'q'  :
  2502. XX           case 'Q'  : return(TRUE);    /* get OUTTA here! */
  2503. XX           default   : putchar(BEEP);    
  2504. XX               fflush(stdout);
  2505. XX               break;
  2506. XX         }
  2507. XX      } while (! okay_char);
  2508.  
  2509. XX      CursorLeft(11);        /* back up to the beginning of line */
  2510. XX      CleartoEOLN();
  2511. XX    }
  2512.  
  2513. XX    Write_to_screen("%s", 1, line);
  2514.  
  2515. XX    lines_displayed     += 1;           /* tossed on screen */
  2516. XX    lines_put_on_screen += lines_needed;       /* read from file   */
  2517.  
  2518. XX    return (FALSE);
  2519. XX}
  2520. XXEND_OF_FILE
  2521.  
  2522. XXchars=`cat src/builtin.c | wc -c`
  2523.  
  2524. XXif [ $chars -ne 2825 ]
  2525. XXthen
  2526. XX  echo File damaged in transit...should be 2825 bytes, is $chars instead
  2527. XX  echo  I suggest you check it closely...
  2528. XXfi
  2529.  
  2530. XX#-------------------------------------
  2531. XX# File 'src/getopt.c' diffs...
  2532.  
  2533. XXcat << 'EOF' > src/getopt.c.D
  2534. XX83c
  2535. XX    if (word == NULL)
  2536. XX      return(ERROR);        /* Sun compatibility */
  2537.  
  2538. XX    if (word == NULL || strlen(word) == 0) 
  2539. XX.
  2540. XX71,75d
  2541. XX66c
  2542. XX    if (_argnum >= argc) {
  2543. XX.
  2544. XX61,64d
  2545. XX57c
  2546. XX    if (_indx > strlen(argv[_argnum]) == NULL && _indx > 1) {
  2547. XX.
  2548. XX52c
  2549. XX    if (_argnum >= argc) {    /* quick check first - no arguments! */
  2550. XX.
  2551. XX18a
  2552.  
  2553. XX.
  2554. XX7a
  2555. XX#include "defs.h"
  2556.  
  2557. XX.
  2558. XXw
  2559. XXEOF
  2560.  
  2561. XXchars=`cat src/getopt.c | wc -c`
  2562.  
  2563. XXif [ $chars -ne 2253 ]
  2564. XXthen
  2565. XX  echo Your file src/getopt.c has been changed\!
  2566. XX  echo diffs saved as \"src/getopt.c.D\"
  2567. XXelse
  2568. XX  echo applying diffs to file src/getopt.c...
  2569. XX  /bin/cat src/getopt.c.D | /bin/ed - src/getopt.c
  2570. XXfi
  2571.  
  2572. XXecho end of autodiff, part 1
  2573. XXexit 0
  2574.  
  2575. @//E*O*F Edit1//
  2576. chmod u=rwx,g=rwx,o=rwx $OUT
  2577.  
  2578. echo Inspecting for damage in transit...
  2579. temp=/tmp/sharin$$; dtemp=/tmp/sharout$$
  2580. trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
  2581. cat > $temp <<\!!!
  2582.     2543    7256   53137 Edit1
  2583. !!!
  2584. wc  Edit1 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
  2585. if test -s $dtemp ; then
  2586.     echo "Ouch [diff of wc output]:"
  2587.     cat $dtemp
  2588.     STATUS=1
  2589. elif test $STATUS = 0 ; then
  2590.     echo "No problems found."
  2591. else
  2592.     echo "WARNING -- PROBLEMS WERE FOUND..."
  2593. fi
  2594. exit $STATUS
  2595.